package cn.bs.mapper;

import cn.bs.domain.dao.Canteen;
import cn.bs.domain.dao.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CanteenMapper extends BaseMapper<Canteen> {
    List<Canteen> getCanteenList();

    Canteen getById(Integer canteenId);

    Integer getMaxId();

    @Select("SELECT * FROM canteen LIMIT #{size} OFFSET #{offset}")
    List<Canteen> getCanteenListWithPagination(@Param("offset") int offset, @Param("size") int size);

    @Select("SELECT COUNT(*) FROM canteen")
    int getTotalCanteens();

    List<Canteen> getAll();

    List<Canteen> getCanteenByName(String name);

}
